import cv2
import os

# def getImageVar(imgPath):
#     image = cv2.imread(imgPath)
#     filename = os.path.split(imgPath)[-1].replace(".png","")
#
#     cv2.imshow("instance_{}".format(filename),image)
#
#     img2gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
#     cv2.imshow("gray_{}".format(filename), img2gray)
#
#     imagelap = cv2.Laplacian(img2gray, cv2.CV_64F)
#     cv2.imshow("lap_{}".format(filename), imagelap)
#
#     imageVar = imagelap.var()
#
#     return imageVar
#
# print(getImageVar("instance.png"))
# print(getImageVar("instance_gaussianblur.png"))
# cv2.waitKey(0)

img = cv2.imread("instance.png")
img = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
print(img.shape)
img = cv2.cvtColor(img,cv2.CV)
print(img.shape)
img = cv2.cvtColor(img,cv2.CV_8UC1)
print(img.shape)